STEP 2: Nice! Now that our stage is set up, let's start our game by creating the data we need inside main().

  • Our game increases or decreases the user's score, depending on which sprite the user clicks on.
  • In , drag Global Variable indented your main function. Make sure it's indented!
  • Change my_var to score. We need to make score global, since we'll be using it in another function.
  • Finally, drag in Integer Variable on the next line. Change my_var to score and 25 to 0.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)